package com.yanqu.road.server.cmd.wingroom;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.wingroom.WingRoomProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.wingroom.CrossWingRoomMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_WING_ROOM_CROSS_CAL_EVENT_RED_DOT, desc = "计算呼朋唤友事件红点")
public class CrossCalEventRedDotCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        WingRoomProto.CrossCalEventRedDotReqMsg reqMsg = WingRoomProto.CrossCalEventRedDotReqMsg.parseFrom(packet.getBytes());

        MessageHelper.sendPacket(serverId, packet.getPlayerId(), YanQuMessageUtils.buildMessage(Protocol.S_WING_ROOM_CROSS_CAL_EVENT_RED_DOT_FROM_CROSS,
                CrossWingRoomMgr.calEventRedDot(packet.getPlayerId(), reqMsg.getFriendList())));
    }

    @Override
    public void sendData() {

    }
}
